//
// C++ Interface: tree
//
// Description: The Tree widget derives from View. It can be used to display a hierarchical list of items,
//	such as the headings in a document, the entries in an index, or the files and directories on a disk.
//	The data is gathered from the model.
//
//
// Author: Os3 s.r.l. <xgui@os3.it>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//

#ifndef _XGUI_TREE_H_
#define _XGUI_TREE_H_

#include "xguifwd.h"
#include "view.h"

namespace xguimpl { struct Tree; }

namespace xgui
{
	class TextPairCallback;

    %feature("docstring","derives from :class:`xgui.ViewClass` ") TreeClass;
	struct TreeClass : public xgui::ViewClass
	{
		TreeClass();
		std::string const &className();
		bool isInstanceable();
		xgui::Object * create(xgui::Object * parent, xgui::StringMap &properties);

		virtual bool canContain(xgui::ClassInfo * c);
	};

    %feature("docstring","**DESCRIPTION**\n\nThe Tree widget can be used to display a hierarchical list of items, such as the headings in a document, the entries in an index, or the files and directories on a disk. The data is gathered from the model.\n\n**PROPERTIES**\n\n* **has-icons** *(RW):* if set to \"1\" an icon is displayed near the text of each item; if set to \"0\" no icon is displayed.\n\n* **has-checkboxes** *(RW):* if set to \"1\" a checkbox is displayed near the text of each item; if set to \"0\" no checkbox is displayed.\n\n**EVENTS**\n\n* **onselect** *(linked to* :class:`xgui.TextCallback` *):* fired when the user changes the select state of a tree node. the string parameter of the callback function is the path (see Widget::getPath()) of the item (de)selected. the status parameter is *1* if the item has been selected, *0* otherwise.\n\n* **onrefresh** *(linked to* :class:`xgui.Callback` *):* fired when the user inserts or removes an item or calls the refresh() method.\n\n* **oncheck** *(linked to* :class:`xgui.TextStatusCallback` *):* fired when the user changes the check state of a tree node.the string parameter of the callback function is the path (see :meth:`xgui.Widget.getPath()` ) of the item (un)checked. the status parameter is *1* if the item has been checked, *0* otherwise.\n\n**METHODS**\n\n") Tree;
	class Tree : public xgui::View
	{
		protected:
			Tree ( xgui::Container * parent, xgui::StyleManager * sm );
			virtual ~Tree();

		public:
		    %feature("docstring","sorts the children of the specified tree node. <callback> is a callback function for item comparison.\n\n*C++*::\n\n void sort ( xgui::Model * node, xgui::TextPairCallback * callback );\n\n") sort;
			virtual void sort ( xgui::Model * node, xgui::TextPairCallback * callback );
			%feature("docstring","expands the list of child items associated with the specified node item.\n\n*C++*::\n\n void expand ( xgui::Model * node );\n\n") expand;
			virtual void expand ( xgui::Model * node );
			%feature("docstring","collapses the list of child items associated with the specified node item.\n\n*C++*::\n\n void collapse ( xgui::Model * node );\n\n")collapse;
			virtual void collapse ( xgui::Model * node );

            %feature("docstring","returns true if the item identified by <parent> and <child_pos> is in the \"checked\" state; false otherwise.\n\n*C++*::\n\n bool isChecked ( xgui::Model * parent, int child_pos );\n\n") isChecked;
			virtual bool isChecked ( xgui::Model * parent, int child_pos );
            %feature("docstring","changes the check state of the item identified by <parent> and <child_pos>.If <state> is set to true the state is changed to *\"checked\"* , otherwise is changes to *\"unchecked\"* .\n\n*C++*::\n\n isChecked ( xgui::Model * parent, int child_pos );\n\n") check;
			virtualbool isChecked ( xgui::Model * parent, int child_pos );
			%feature("docstring","It changes the check state of all child items of the specified node.If <state> is set to true the state is changed to *\"checked\"* , otherwise is changes to *\"unchecked\"* .\n\n*C++*::\n\n virtual void checkAll ( xgui::Model * parent, bool state );\n\n") checkAll;
			virtual void checkAll ( xgui::Model * parent, bool state );
	};
}

#endif
